﻿<UserControl x:Class="ODAF.SilverlightApp.CreatePointView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="320" Height="280">
    
    

    <Grid x:Name="LayoutRoot">
        
        

        <StackPanel Orientation="Vertical">
            <Border BorderBrush="Gray"  Background="#EFEFEF" Margin="0,0,0,-1" CornerRadius="4" Padding="4" Width="320" Height="230">
                <Grid  Margin="0">
                    <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="0">
                        <TextBlock x:Name="tbTitle" 
                                   FontWeight="Bold" 
                                   TextAlignment="Left" 
                                   HorizontalAlignment="Left"
                                   Margin="0,4,0,4"
                                   Width="300">Add a Landmark</TextBlock>
                        <StackPanel x:Name="PointEntry" Orientation="Vertical" HorizontalAlignment="Stretch" Margin="0">

                            <Grid Width="312">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="3*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Margin="0" Grid.Column="0">Name</TextBlock>
                                <TextBlock x:Name="tbNameReq"  
                                           Grid.Column="1" 
                                           TextAlignment="Right" 
                                           HorizontalAlignment="Right"
                                           Visibility="Collapsed"
                                           Foreground="Red">8 or more letters please.</TextBlock>
                            </Grid>
                            <TextBox x:Name="tbName" 
                                     TextWrapping="Wrap" 
                                     Margin="0,0,0,4" 
                                     Width="312" 
                                     TextChanged="tbName_TextChanged"
                                     LostFocus="tbName_LostFocus"
                                     AcceptsReturn="False">
                                <ToolTipService.ToolTip>
                                    <StackPanel>
                                        <TextBlock TextWrapping="Wrap" TextAlignment="Left" HorizontalAlignment="Left" Text="Please give your landmark a name."/>
                                        <TextBlock Text="Make it meaningful.  Hint: Must be at least 8 letters."/>
                                    </StackPanel>
                                </ToolTipService.ToolTip>

                            </TextBox>
                            
                            <Grid Width="312">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="3*"/>
                                </Grid.ColumnDefinitions>
                                
                                <TextBlock Margin="0" Grid.Column="0">Description</TextBlock>
                                <TextBlock x:Name="tbDescReq" 
                                           Grid.Column="1" 
                                           TextAlignment="Right" 
                                           HorizontalAlignment="Right"
                                           Visibility="Collapsed"
                                           Foreground="Red">8 or more letters please.</TextBlock>
                            </Grid>
                           
                            <TextBox x:Name="tbDescription" 
                                     TextWrapping="Wrap" 
                                     Height="100"
                                     Width="312" 
                                     VerticalScrollBarVisibility="Visible"
                                     Margin="0" Padding="0" 
                                     TextChanged="onTextChanged"
                                     HorizontalAlignment="Left" 
                                     MaxLength="1000"
                                     AcceptsReturn="True">
                                <ToolTipService.ToolTip>
                                    <StackPanel>
                                        <TextBlock TextWrapping="Wrap" TextAlignment="Left" HorizontalAlignment="Left" Text="Please describe your landmark."/>
                                        <TextBlock Text="Make it meaningful.  Hint: Must be at least 8 letters."/>
                                    </StackPanel>
                                </ToolTipService.ToolTip>
                            </TextBox>
                            
                            <Grid Margin="0,4,-4,4" Width="300">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="60"/>
                                    <ColumnDefinition Width="60"/>
                                </Grid.ColumnDefinitions>
                                
                                <TextBlock Grid.Column="0" 
                                           Width="180" Height="32" TextWrapping="Wrap">Drag the pin to place your landmark.</TextBlock>
                                <Button x:Name="btnSave" Grid.Column="1" Content="Save" Margin="2" Click="Save_Click"/>
                                <Button x:Name="btnCancel" Grid.Column="2" Content="Cancel" Margin="2" Click="Cancel_Click"/>
                                </Grid>

                        </StackPanel>
                    </StackPanel>
                </Grid>
            </Border>

            <Image Source="Images/callout_bottom.png" Stretch="None"/>
        </StackPanel>

        <Image x:Name="btnClose" 
               Source="Images/CancelButton.png" 
               MouseLeftButtonUp="btnClose_MouseLeftButtonUp"
               MouseEnter="btnClose_MouseEnter"
               MouseLeave="btnClose_MouseLeave"
               Stretch="None" 
               Margin="0,4,4,0"
               HorizontalAlignment="Right" 
               VerticalAlignment="Top"/>
    </Grid>
</UserControl>